#ifndef MW_DH_H
#define MW_DH_H


/*
  Meanwhile - Unofficial Lotus Sametime client library
  
  Copyright (c) 2007 Christopher O'Brien <siege@preoccupied.net>
  
  License: LGPL
  
  This library is free software; you can redistribute it and/or modify
  it under the terms of version 2 the GNU Library General Public
  License as published by the Free Software Foundation.
                                                                                
  This library is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Library General Public License for more details.
  
  You should have received a copy of the GNU Library General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA
*/


/** @file mw-dh.h
    @since 2.0.0

    Utility functions for the doing Diffie-Hellman key exchanges.
    These functions hardcode the predetermined print and base
    values. */


#include "mw-mpi.h"


G_BEGIN_DECLS


const MwMPI *mw_dh_get_prime();


#define MW_DH_PRIME (mw_dh_get_prime())


const MwMPI *mw_dh_get_base();


#define MW_DH_BASE (mw_dh_get_base())


/** sets private and public to a randomly generated 512 bit keypair
    using MW_DH_PRIME and MW_DH_BASE */
void mw_dh_generate_keypair(MwMPI *private, MwMPI *public);


/** sets shared to the computed shared key determined from
    remote_public, local_private, MW_DH_PRIME, and MW_DH_BASE */
void mw_dh_calculate_shared(MwMPI *shared,
			    const MwMPI *remote_public,
			    const MwMPI *local_private);


G_END_DECLS


#endif /* MW_DH_H */
